﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace DeleteWithPrice
{
    class Program
    {
        static void Main(string[] args)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load("../../catalog.xml");
            bool more=true;
            while (more == true)
            {
                more = false;
                foreach (XmlNode node in doc.DocumentElement)
                {
                    if (int.Parse(node["price"].InnerText) < 80)
                    {
                        doc.DocumentElement.RemoveChild(node);
                        more = true;
                    }
                }
            }
            Console.WriteLine("Modified XML document:");
            Console.WriteLine(doc.OuterXml);

           // doc.Save("../../itemsNew.xml");
        }
    }
}
